<template>
  <a-card :bordered="false" class="addOrder">
    <el-page-header @back="$router.go(-1)" style="margin-bottom:10px"></el-page-header>
    <el-form
      :model="ruleForm"
      :rules="rules"
      ref="ruleForm"
      :labelWidth="labelWidth"
      class="demo-ruleForm"
    >
      <!-- 基本信息 -->
      <com-title :styleIng="{margin:'10px 0px 10px 10px'}" :isShow="false">
        <span slot="title">基本信息</span>
        <el-row :gutter="10" slot="table">
          <el-col :xs="24">
            <el-form-item label="出库日期：" required>
              <a-date-picker @change="cxsjChange" style="width:30%">
                <a-icon slot="suffixIcon" type="smile" />
              </a-date-picker>
            </el-form-item>
          </el-col>
          <el-col :xs="24">
            <el-form-item label="出库原因：" prop="outStockReason">
              <!-- <a-input
                v-model="ruleForm.outStockReason"
                placeholder="请填写出库原因"
                :disabled="disabled"
              /> -->
              <a-select
                v-model="ruleForm.outStockReason"
                placeholder="请选择出库原因"
                :disabled="disabled"
                style="width:30%"
              >
                <a-select-option
                  :value="item.value"
                  v-for="(item,index) in inStockReasonList"
                  :key="index"
                >{{item.label}}</a-select-option>
              </a-select>
            </el-form-item>
          </el-col>
          <el-col :xs="8">
            <el-form-item label="接收方：" prop="lx">
              <a-radio-group v-model="ruleForm.lx" @change="pslxChange">
                <a-radio :value="1">总仓</a-radio>
              </a-radio-group>
            </el-form-item>
          </el-col>
          <el-col :xs="24">
            <el-form-item label="备注：">
              <a-input
                v-model="ruleForm.remarks"
                placeholder="请填写备注"
                type="textarea"
                :disabled="disabled"
                style="width:30%"
              />
            </el-form-item>
          </el-col>
        </el-row>
      </com-title>

      <!-- 采购信息 -->
      <com-title :styleIng="{margin:'10px 0px 10px 10px'}" :isShow="false">
        <span slot="title">
          <span>出库信息</span>
          <a-button
            type="primary"
            style="margin-left:10px;position: relative;top: -3px;"
            v-if="ruleForm.lx == 2"
            @click="addStore"
          >添加直送门店</a-button>
        </span>
        <buyingIfor
          :ShopOrGoods="ruleForm.lx == 2"
          slot="table"
          ref="buyingIfor"
          style="margin:10px 0px 10px 10px"
        />
      </com-title>
      <div class="content">
        <a-button type="primary" @click="submitSave('ruleForm')">提交退货出库单</a-button>
        <a-button @click="quxiao('ruleForm')">取消</a-button>
      </div>
    </el-form>
    <choiceShop ref="choiceShop" @trigger="trigger" />
  </a-card>
</template>

<script src='./index.js'></script>

<style lang="less">
.addOrder {
  .content {
    text-align: center;
    margin: 20px 0px;
    button {
      margin-right: 10px;
    }
  }
}
.upload_list {
  & > div {
    float: left;
    margin-right: 10px;
    & > .imgs {
      width: 150px;
      height: 130px;
      border-top-left-radius: 4px;
      border-top-right-radius: 4px;
    }
    & > div {
      width: 150px;
      margin-bottom: 0;
      text-align: center;
      background-color: #fafafa;
      display: flex;
      justify-content: center;

      span {
        padding-right: 10px;
        cursor: pointer;
      }
    }
  }
  .avatar-uploader {
    float: left;
  }
}
</style>
